<%@ page language="java" import="java.util.*,SiTuQingYou.vo.*,SiTuQingYou.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
      String path = request.getContextPath();
    %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/houtai/js/jquery-3.3.1.min.js"></script>
<style type="text/css">
     #yemian{padding:50px;margin-top:30px;margin:50px;}
     .pager a{
       display:inline-block;
       width:35px;
       height:35px;
       background-color:gray;
       color:white;
       text-align:center;
       line-height:35px;
       border-radius:18px;
       text-decoration:none;
       }
 
      .pager a.cur{
       background-color:green;
       } 
       
       .sc img{width:160px;height:160px;}
       .sc{width:1200px;height:164px;margin-top:30px;border-top:2px solid gray;}
       .tupian{float:left;height:162px;width:162px;}
       .neirong{float:left;height:162px;width:1032px;background-color:#ddd;}

       .zhuti{height:30px;font-size:22px;font-weight:600;padding-left:40px;color:gray;text-decoration:none;cursor:pointer;}
       .scene{height:22px;padding-left:40px;font-size:16px;}
       .auditstatus{height:25px;padding-left:40px;font-size:16px;font-weight:600;}
       .content{height:85px;padding-left:40px;font-size:16px;overflow:auto;}
        
</style>


</head>
<body>
      <jsp:include page="header.jsp"></jsp:include>
      
      <div id="yemian">
         <jsp:include page="/StrategyServlet"><jsp:param value="showAllWritedStrategy" name="method"/></jsp:include>
         <%
         ArrayList<Strategy> writedstr = (ArrayList<Strategy>)request.getAttribute("writedstr");
         Pager pager = (Pager) request.getAttribute("pager");
         %>
         <%for(Strategy s:writedstr){ %>
              <div class="sc">
                   <!-- 图片 -->
                   <div class="tupian">
                        <img src="<%=path%>/imagess/<%=s.getPhoto()%>">
                   </div>
                   <div class="neirong">
                        <div class="zhuti"><a id="<%=s.getId() %>" href="javascript:void(0)"><%=s.getTitle()%></a></div><!-- 攻略题目 -->
                        <!-- 对应景点 和 发表时间 -->
                        <div class="scene">
                                                                        发表时间：<%=s.getStime() %>
                                                                        景点：<a href="<%=path%>/index/sceneinfo.jsp?method=sceneinfo&id=<%=s.getScene().getId()%>"><%=s.getScene().getScenename() %></a>
                                                                        
                        </div>
                        <!-- 审核状态 -->
                        <div class="auditstatus">
                             <% int auds= s.getAuditstatus();
                                if(auds==0){%><font color="red"><%="尚未审核" %></font><%}
                                if(auds==1)
                                {%>
                                <font color="#3CB371"><%="审核通过" %></font>
                                <script type="text/javascript">
                                $("#<%=s.getId()%>").attr("href","<%=path %>/index/strategyinformation.jsp?id=<%=s.getId()%>");
                                </script>
                                
                                <%}
                                if(auds==2){%><font color="#808080"><%="审核不通过：" %><%=s.getThereason()%></font><%}
                             %>
                        </div>
                        <!-- 内容详情 -->
                        <div class="content"><%=s.getContent() %></div>
                   </div>
              </div>
         <%} %>
         
         <!-- 显示页码 -->
         <div class="pager">
         <%
           for(int i=1;i<=pager.getPageCount();i++)
           {%>
              <a href="<%=path%>/index/mystrategy.jsp?pageNum=<%=i%>" class=<%=(i==pager.getPageNum()?"cur":"")%>><%=i%></a>
           
          <%}%>
                         共<%=pager.getPageCount() %>页   共<%=pager.getDataCount() %>记录
      </div>
      </div>
      <jsp:include page="footer.jsp"></jsp:include>
</body>
</html>